#ifndef FRAMEBUFFER_HPP
#define FRAMEBUFFER_HPP

//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <string>
#include <vector>
#include <Rendering/Texture.hpp>
#include <Rendering/Enumeration.hpp>
#include <Tools/SmartPointer.hpp>

namespace Rendering {

//-----------------------------------------------------------------------------
class FrameBuffer;
typedef Tools::SmartPointer<FrameBuffer> TFrameBufferPointer;
//-----------------------------------------------------------------------------
class FrameBuffer {
public:	
	// Desttructor
	~FrameBuffer();	
	// Add a target
	void AddTarget(TargetType type, PixelFormat format);
	// Get target
	TITexturePointer GetTarget(TargetType type);
	// Enable target
	void Enable();
	// Disable target
	void Disable();
	// Create frame buffer
	static TFrameBufferPointer CreateFrameBuffer(int width, int height);
private:
	// Constructor	
	FrameBuffer(int width, int height);
	// Type	definitions
	struct Target {
		TITexturePointer target; // Texture target
		TargetType type;		 // Target type
	};
	typedef std::vector<Target> TTargetVector;
	// Constructor	
	FrameBuffer();
	FrameBuffer(const FrameBuffer& copy);	
	FrameBuffer& operator=(const FrameBuffer& copy);
	// Attributes
	TRenderingID frameBufferID;
	int width;
	int height;
	TTargetVector targets;
};
//-----------------------------------------------------------------------------
}
#endif //FRAMEBUFFER_HPP
